import request from '@/utils/request'


// 查询任务申请列表
export function getHallList(param) {
	return request.get('task/hall/list', param)
}


// 获取大厅任务详细信息
export function applyById(id) {
	return request.get('task/hall/' + id)
}

// 获取任务类型
export function timed_task_type() {
	return request.get('system/dict/data/type/timed_task_type')
}


export const setApply = (data) => {
  return request.post('task/apply', data)
}


export const medicalRepresentative = (id) => {
  return request.get('base/medicalRepresentative/' + id)
}

export const upMedicalRepresentative = (data) => {
  return request.put('base/medicalRepresentative', data)
}

export const upAgency = (data) => {
  return request.put('base/agency', data)
}

export const agencyBuId = (id) => {
  return request.get('base/agency/' + id)
}

// 查询代表需要签订的协议
export const listByMr = (load=true) => {
  return request.get('base/agreement/list-by-mr',{},{load})
}

// 代表签订协议
export const addAgreement = (data) => {
  return request.post('base/medicalRepresentative/add-agreement', data)
}


// 新增代理商协议
export const addagencyAgreement = (data) => {
  return request.post('base/agency/add-agreement', data)
}


// 获取医药代表详细信息
export const medicalRepresentativeBuId = (id) => {
  return request.get('base/medicalRepresentative/' + id)
}

// 查询消息列表
export const messageList = (data) => {
  return request.get('system/message/list', data)
}


export const messageBuId = (id) => {
  return request.get('system/message/' + id)
}

// 标记消息已读
export const signReadId = (id) => {
  return request.get('system/message/sign-read/' + id)
}


// 查询积分明细
export const finIntegrallistItem = (data) => {
  return request.get('task/finIntegral/list-item', data)
}

// 获取积分详细信息
export const finIntegralById = (id) => {
  return request.get('task/finIntegral/' + id)
}

// 获取积分详细信息
export const getCor = (data) => {
  return request.post('base/agency/get-token', data)
}

// 获取代理商详细信息
export const agencyById = (id) => {
  return request.get(`/base/agency/${id}`)
}

// 获取培训
export const trainingById = (id) => {
  return request.get(`/study/training/${id}`)
}

// 获取用户信息
export const userById = (id) => {
  return request.get(`system/user/${id}`)
}

export const upUser = (data) => {
  return request.put('/system/user', data)
}